{extend name="base" /}
{block name="body"}
<div class="layui-card">
	<div class="layui-card-body">
        <div class="layui-btn-group fl">
		    <a href="{:url('admin/user/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加会员</a>
			<a href="{:url('admin/user/import')}" class="layui-btn ajax-iframe" data-width="500px" data-height="300px"><i class="fa fa-plus-circle"></i> 批量导入</a>
		    <a href="{:url('admin/user/export')}" class="layui-btn layui-btn-primary"><i class="fa fa-file-excel-o"></i> 导出会员</a>
        </div>
		<div class="fl ml20">
			<form action="{:url('admin/user/index')}" class="layui-form" method="get" style="padding:0px;">
				<div class="layui-form-item">
					<div class="layui-input-inline">
						<input type="text" name="key" value="{:input('key')}" autocomplete="off" placeholder="用学员用户名或手机号搜索" class="layui-input"/>
					</div>
					<div class="fl">
						<button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>
					</div>
				</div>
			</form>
		</div>
		<table class="layui-table layui-form">
			<thead>
				<tr>
					<th>ID</th>
					<th>用户名</th>
					<th>手机号</th>
					<th>余额</th>
					<th>上次登录时间</th>
					<th>登录次数</th>
					<th>创建时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{foreach name="list" item="v" empty="$empty"}
				<tr>
					<td>{$v.id}</td>
					<td>{$v.username}</td>
					<td>{$v.mobile}</td>
					<td>{$v.yue}</td>
					<td>{if empty($v.last_login_time)}无{else/}{$v.last_login_time|date='Y-m-d H:i:s', ###}{/if}</td>
					<td>{$v.login_count}</td>
					<td>{$v.create_time}</td>
					<td>
						<input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('admin/user/edit', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
					</td>
					<td>
						<div class="layui-btn-group mb0">
							<a href="{:url('admin/user/edit', ['id' => $v.id])}" class="layui-btn layui-btn-xs"> <i class="layui-icon">&#xe642;</i></a>
							<a href="{:url('admin/user/addmoney', ['id' => $v.id])}" class="layui-btn layui-btn-xs  layui-btn-normal  ajax-iframe" data-width="600px" data-height="400px" data-type="admin"><i class="layui-icon">&#xe65e;</i></a>
							<!--<a href="{:url('admin/user/course', ['id' => $v.id])}" class="layui-btn layui-btn-xs  layui-btn-warm   ajax-iframe" data-width="600px" data-height="400px" data-type="admin" ><i class="layui-icon">&#xe62c;</i></a>-->
							<a href="{:url('admin/user/del', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"> <i class="layui-icon">&#xe640;</i></a>
						</div>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<div class="page">{$list->render()}</div>
	</div>
</div>
{/block}
